-
-
Notifications
You must be signed in to change notification settings - Fork 192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Automounter #360
Add Automounter #360
Conversation
# disable automatic opening of file manager | ||
FM='' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may eventually be configured to automatically open up Filer if desired.
# PENDRIVE/PHONE/SDCARD insert | ||
notify 100 { | ||
match "system" "DEVFS"; | ||
match "type" "CREATE"; | ||
match "cdev" "(da|mmcsd|ugen)[0-9]+.*"; | ||
action "/usr/sbin/automount $cdev attach &"; | ||
}; | ||
|
||
# PENDRIVE/PHONE/SDCARD remove | ||
notify 100 { | ||
match "system" "DEVFS"; | ||
match "type" "DESTROY"; | ||
match "cdev" "(da|mmcsd|ugen)[0-9]+.*"; | ||
action "/usr/sbin/automount $cdev detach &"; | ||
}; | ||
|
||
# CD-ROM media inject | ||
notify 100 { | ||
match "system" "DEVFS"; | ||
match "type" "CREATE|MEDIACHANGE"; | ||
match "cdev" "(cd)[0-9]+.*"; | ||
action "/usr/sbin/automount $cdev attach &"; | ||
}; | ||
|
||
# CD-ROM media eject | ||
notify 100 { | ||
match "system" "DEVFS"; | ||
match "type" "DESTROY"; | ||
match "cdev" "(cd)[0-9]+.*"; | ||
action "/usr/sbin/automount $cdev detach &"; | ||
}; | ||
|
||
# CD-ROM no media | ||
notify 100 { | ||
match "system" "CAM"; | ||
match "subsystem" "periph"; | ||
match "type" "error"; | ||
match "cam_status" "0xcc"; | ||
match "scsi_status" "2"; | ||
match "scsi_sense" "70 02 3a 02"; | ||
match "device" "(cd)[0-9]+.*"; | ||
action "/usr/sbin/automount $device detach &"; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
devd
-specific configuration
@@ -420,6 +420,7 @@ DIRDEPS+= \ | |||
usr.sbin/auditreduce \ | |||
usr.sbin/authpf \ | |||
usr.sbin/autofs \ | |||
usr.sbin/automount \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
include the appropriate makefile for automount
# read configuration files | ||
if [ -f /etc/automount.conf ] ; then | ||
. /etc/automount.conf | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the only difference between this automount and the upstream vermaden/automount. vermaden/automount doesn't support /etc/automount.conf
by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! I will make a separate issue for those extra filesystem packages - we need to build and package those into the ISO. This can be merged as is for now. Thanks for your contribution!
Re: #355
A slightly modified version of vermaden/automount was bundled into the userland, and devd was configured accordingly. It resides in
/usr/sbin/automount
, and is automatically called by devd when removable media is inserted, as well as events related to CD-ROMS (devd-specific configuration is located at/etc/devd/automount_devd.conf
). A pre-configured automount.conf is bundled into/etc/automount.conf
, with the configuration to perform as needed.Upon insertion, removable media should now be automatically mounted under
/Volumes
, and upon removal the corresponding directory should be deleted. In addition, automount is configured to prefer the volume label over the device name.I couldn't figure out how to initialize the packages it needs into the base system itself, e.g:
sysutils/exfat-utils
for exFATsysutils/fusefs-ntfs
for NTFSsysutils/fusefs-ext2
for EXT4sysutils/fusefs-hfsfuse
for HFS/HFS+sysutils/fusefs-lkl
for XFSsysutils/fusefs-simple-mtpfs
for MTPBut once those are installed, automount should have everything it needs to function perfectly.